home *** CD-ROM | disk | FTP | other *** search
- property ancestor, pPathFunctionData, pCurrentLoc, pStartLoc
-
- on birth me, arguments
- set the ancestor of me to birth(script "Animator", arguments)
- set the pPathFunctionData of me to the pathData of arguments
- set pStartLoc to the location of arguments
- set pCurrentLoc to pStartLoc
- return me
- end
-
- on moveSprite me
- if the pPathFunctionData of me = #PresentTrendbarStockLoc then
- set theResult to PresentTrendbarStockLoc(me)
- else
- if the pPathFunctionData of me = #PastTrendbarStockLoc then
- set theResult to PastTrendbarStockLoc(me)
- end if
- end if
- set the pCurrentLoc of me to theResult
- set the loc of sprite the pChannel of me to the pCurrentLoc of me
- end
-
- on PresentTrendbarStockLoc me
- set startloc to the pCurrentLoc of me
- set V to the locV of startloc
- if V < 0 then
- return point(-1000, -1000)
- end if
- set H to the locH of startloc + 2
- if H > 526 then
- set aloc to point(34, 60)
- else
- set aloc to point(H, V)
- end if
- return aloc
- end
-
- on PastTrendbarStockLoc me
- set PresentOBJAnim to getaProp(getaProp(gObjects, #PresentTrendBar), #animator)
- set pastOffsetH to getaProp(getaProp(gObjects, #PresentTrendBar), #pastOffsetH)
- set timeInterval to getaProp(getaProp(gObjects, #ShortTermStock), #timeInterval)
- set timeScale to getaProp(getaProp(gObjects, #ShortGraphs), #timeScale)
- set PresentLoc to the pCurrentLoc of PresentOBJAnim
- set pastV to the locV of PresentLoc
- if pastV < 0 then
- return point(-1000, -1000)
- end if
- set pastH to the locH of PresentLoc - pastOffsetH - (timeScale * (timeInterval - 5))
- if pastH > 526 then
- set pastH to 34 + pastH - 526
- else
- if pastH < 34 then
- set pastH to 526 - (34 - pastH)
- end if
- end if
- return point(pastH, pastV)
- end
-